package de.reiberger.minesweeper.gui;

import java.awt.GridLayout;
import java.util.ArrayList;
import java.util.List;
import java.util.Random;

import javax.swing.JFrame;

public class MainFrame extends JFrame {
		
	private List<Mines> _mines = new ArrayList<>();
	private Random rand = new Random();
	
	public MainFrame() {
		super("Minesweeper");
		this.setLayout(new GridLayout(10, 10));
		this.createUserField(10, 10);
	}
	
	private void createUserField(int x, int y) {
		if (y != 0) {
			if(x == 0) {
				this.createUserField(10, y - 1);
			}
			else {
				Mines jb = new Mines(x, y, rand.nextBoolean());
				this.add(jb);
				this._mines.add(jb);
				this.createUserField(x-1, y);
			}
		}
	}
}
